<?php
$conn = new mysqli("localhost", "username", "password", "database");
if ($conn->connect_error) {
    die("连接失败: " . $conn->connect_error);
}

$taskId = $_GET['id'];
$sql = "UPDATE tasks SET status = 'completed' WHERE id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i", $taskId);
$stmt->execute();

echo json_encode(['success' => true]);
$stmt->close();
$conn->close();
?>
